package com.quotes.indicators;

import com.quotes.datamodell.*;

public class CoppockIndicator
{
	private TimeSeries coppoc = null;
	
	public CoppockIndicator(Quotes quotes, int a, int b, int c) {
		TimeSeries close = quotes.getQuote(QuotesType.CLOSE);
		TimeSeries rocX = RocIndicator.calculateRateOfChange(close, a);
		TimeSeries rocY = RocIndicator.calculateRateOfChange(close, b);
		coppoc = TimeSeriesCalculator.calculateExponentialMovingAverage(rocX.add(rocY), c);
	}
	
	public TimeSeries getCoppoc() {
		return coppoc;
	}
}
